package routers

import (
	beego "github.com/beego/beego/v2/server/web"
	"new/controllers"
)

func init() {
	beego.Router("/", &controllers.MainController{})
	beego.Router("/new/ask", &controllers.NewController{}, "post:Ask")
	beego.Router("/new/upload", &controllers.NewController{}, "post:Upload")
	beego.Router("/new/type", &controllers.NewController{}, "get:NewType") //分类查询

	beego.Router("/new/list", &controllers.NewController{}, "get:List")
	beego.Router("/new/info", &controllers.NewController{}, "get:Info")
	beego.Router("/new/del", &controllers.NewController{}, "delete:Del")
	beego.Router("/new/update", &controllers.NewController{}, "post:Update")

	beego.Router("register", &controllers.UserController{}, "post:Register")
	beego.Router("login", &controllers.UserController{}, "get:Login")

	//beego.Router("/comment/add", &controllers.CommentController{}, "post:Add")
	//beego.Router("/new/answers", &controllers.NewController{}, "get:Answers")
	beego.Router("/new/comment", &controllers.NewController{}, "post:Comment")
	beego.Router("/new/collection", &controllers.NewController{}, "post:Collection")
	beego.Router("/new/collectList", &controllers.NewController{}, "get:CollectList")
	beego.Router("/new/rank", &controllers.NewController{}, "get:Rank")

}
